//用于服务商状态变化调用的api

const api = {
  updateStatus: '/server-user/updateServerAccessStatus',
  addFirstOrder: '/server-user/firstServerOrder',
  uploadPayVoucher: '/server-user/uploadServerUserPayVoucher',
  uploadBusinessLicences: '/server-user/uploadServerUserBusinessLicences',
  updateAddress: '/server-user/updateServerUserAddress',
  getServerUserInfo: '/server-user/getServerUser',
  chooseServerUserStatus: '/server-user/addServerUser',
  //重新选货
  resetGoods:'/server-user/reSelectGoods',
  //首单获取应付款信息
  getFirstOrderInformation:'/server-user/informationForFirstServerOrder'
};

// 更新服务商状态
export const updateStatus = () => {
  return uni.$http.post(api.updateStatus);
};

// 首单
export const addFirstOrder = (data) => {
  return uni.$http.post(api.addFirstOrder, data);
};

// 上传打款凭证
export const uploadPayVoucher = (data) => {
  return uni.$http.post(api.uploadPayVoucher, data);
};

// 上传服务商用户营业执照
export const uploadBusinessLicences = (url) => {
  return uni.$http.post(api.uploadBusinessLicences,url);
};

// 上传（修改）用户地址
export const updateAddress = (data) => {
  return uni.$http.post(api.updateAddress, data);
};

// 获取服务商用户信息
export const getServerUserInfo = () => {
  return uni.$http.get(api.getServerUserInfo);
};

// 选择服务商状态
export const chooseServerUserStatus = (status) => {
  return uni.$http.get(`${api.chooseServerUserStatus}/${status}`);
};


//获取首单信息
export const getFirstOrderInformation=()=>{
	return uni.$http.get(api.getFirstOrderInformation)

}

//重新选货
export const resetGoods=()=>{
	return uni.$http.get(api.resetGoods)
}